﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace zuoye1_2_
{
    internal class Program
    {
        static void Main(string[] args)
        {


            Console.Write("请输入下限：");
            int lower = int.Parse(Console.ReadLine());
            Console.Write("请输入上限：");
            int upper = int.Parse(Console.ReadLine());
            
            int count = 0;
            for (int num = Math.Max(lower, 2); num <= upper; num++)
            {
                if (sushu(num))
                {
                    Console.Write(num);
                    count++;
                    if (count % 10 == 0)
                        Console.WriteLine();
                    else
                        Console.Write(" ");
                }
            }
            if (count % 10 != 0 )
                Console.WriteLine();
        }
            static bool sushu(int num)
            {
                if (num <= 1) return false;
                if (num == 2) return true;
                if (num % 2 == 0) return false;
                for (int i = 3; i <num; i += 2)
                {
                    if (num % i == 0)
                        return false;
                }
                return true;
            }
        
    }
}
